#include"3.23.c.h"

Person dancer[MAXQSIZE];
int main() {
	int i = 0;
	FILE *fp = fopen("DancePartner.txt", "r");
	if (fp==NULL) {
		printf("错误！未找到文件！");
		exit(ERROR);
	}
	const char delimiter[] = "\t";
	char buffer[1000];
	int row=0;
	while (fgets(buffer, 1000, fp) != NULL) {
		//printf("%s", buffer);
		if(row==0){
			row=1;
			continue;
		}
		char *token;

		int seq = 0;
		// 获取第一个子字符串
		token = strtok(buffer, delimiter);
		// 循环获取所有子字符串
		while (token != NULL) {
			//printf("%s\n", token);
			// 获取下一个子字符串
			
			if(seq==0){
				strcpy(dancer[i].name, token);
			}
			if(seq==1){
				strcpy(dancer[i].sex, token);
			}			
			seq++;
			token = strtok(NULL, delimiter);
		}
		//printf("token\n");
		//file >> L.elem[i].id >> L.elem[i].name >> L.elem[i].price;
		i++;
	}
	DancePartner(dancer, i + 1);
	return 0;
}